<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title></title>
	<include file="Public/header" />
</head>
<body>

<script type="text/javascript">
	var productorderEditUrl="{:U('Product/productorderNumsSave')}";//更新数据
	var getproductorderUrl="{:U('Product/get_changelistorder')}";
	var productorderExamineUrl="{:U('Product/examinechangelistorder')}";

	var productorderInfoUrl="{:U('Product/changelistorderInfo')}";
	var erpId="{:I('id')}";//erp企业对应id
	
	var productinboundUrl="{:U('Product/product_inbound')}";//成品入库
	var productprintUrl="{:U('Product/printproduct')}";//打印
	
	var section_lists={$section_lists};
	var unit_lists={$unit_lists};
	var personnel_lists={$personnel_lists};
	var warehouse_lists={$warehouse_lists};
	
</script>
<script type="text/javascript" src="__PUBLIC__/default/js/changelistorder.js"></script>

	<table id="productorderDatagrid" toolbar="#productorder_tb"></table>
	<!-- 添加 -->
	<div id="productorderSeterpcodeDialog" class="easyui-dialog" title="选择erp" style="width:500px;padding:10px 20px"
        closed="true" buttons="#productorderSeterpcodeButtons"  modal="true">
         <form id="productorderSeterpcodeForm" method="post" novalidate>
            <div class="fitem">
                <label>erp企业</label>
				<input name="ids" id="productorder_push_ids"  value="" type="hidden" />
				<select class="easyui-combobox" name="erp_code" id="product_erp_code" style="width:70px;height:30px;" data-options="required:true,editable:false,panelHeight:'false',validType:['length[2,30]','selected[]']">
                    <option value="0">未选择</option>
					<volist name="erp_list" id="vo">
                        <option value="{$vo['no']}">{$vo['name']}</option>
                    </volist>
                </select> 
			</div>
         </form>
    </div>
    <div id="productorderSeterpcodeButtons">
    	<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onclick="productorderObj.push('{:U('Pushsendapi/productorderPush')}')" style="width:90px">添加</a>
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#productorderSeterpcodeDialog').dialog('close')" style="width:90px">取消</a>
    </div>
    <!-- /添加 -->
	<!-- 添加 -->
	<div id="productorderAddDialog" class="easyui-dialog" title="添加" style="width:500px;padding:10px 20px"
        closed="true" buttons="#productorderAddButtons"  modal="true">
         <form id="productorderAddForm" method="post" novalidate>
			<div class="fitem">
                <label>计划单编号</label>
                <input name="purchasing_no" id="productorder_purchasing_no" class="easyui-textbox" data-options="readonly:true,height:30" />
            </div>
            <div class="fitem">
                <label>申请部门</label>
				<select class="easyui-combobox" name="section_no" id="product_section_no" style="width:70px;height:30px;" data-options="required:true,editable:false,panelHeight:'false',validType:['length[2,30]','selected[]']">
                    <option value="0">未选择</option>
					<volist name="personnel_list" id="vo">
                        <option value="{$vo['no']}">{$vo['name']}</option>
                    </volist>
                </select> 
			</div>
			
			<div class="fitem">
                <label>产品名称</label>
                <input name="pro_name" type="text"  class="easyui-textbox" data-options="required:true,delay:1000,height:30,validType:['length[1,20]']" />
            </div>

			<div class="fitem">
                <label>产品规格</label>
                <input name="pro_spec" type="text"  class="easyui-textbox" data-options="required:true,delay:1000,height:30,validType:['length[1,20]']" />
            </div>
			<div class="fitem">
                <label>料号</label>
                <input name="source_no" type="text"  class="easyui-textbox" data-options="required:true,delay:1000,height:30,validType:['length[1,20]']" />
            </div>
			<div class="fitem">
                <label>产品编码</label>
                <input name="pro_no" type="text"  class="easyui-textbox" data-options="required:true,delay:1000,height:30,validType:['length[1,20]']" />
            </div>
			<div class="fitem">
                <label>批次</label>
                <input name="batch_no" id="productorder_batch_no" type="text"  class="easyui-textbox" data-options="readonly:true,height:30" />
            </div>
			<div class="fitem">
                <label>制单人</label>
                <select class="easyui-combobox" name="people_make_no" id="product_people_make_no" style="width:70px;height:30px;" data-options="required:true,editable:false,panelHeight:'false',validType:['length[2,30]','selected[]']">
                    <option value="0">未选择</option>
					<volist name="personnel_list" id="vo">
                        <option value="{$vo['no']}">{$vo['name']}</option>
                    </volist>
                </select> 
            </div>
			<div class="fitem">
                <label>申请人</label>
                <select class="easyui-combobox" name="people_purchasing_no" id="product_people_purchasing_no" style="width:70px;height:30px;" data-options="required:true,editable:false,panelHeight:'false',validType:['length[2,30]','selected[]']">
                    <option value="0">未选择</option>
					<volist name="personnel_list" id="vo">
                        <option value="{$vo['no']}">{$vo['name']}</option>
                    </volist>
                </select>  
            </div>
         </form>
    </div>
    <div id="productorderAddButtons">
    	<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onclick="productorderObj.add('{:U('Product/productorderAdd')}')" style="width:90px">添加</a>
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#productorderAddDialog').dialog('close')" style="width:90px">取消</a>
    </div>
    <!-- /添加 -->
	<!-- 编辑 -->
    <div id="productorderEditDialog" class="easyui-dialog" style="width:400px;padding:10px 20px"
            closed="true" buttons="#productorderEditButtons"  modal="true">
        <form id="productorderEditForm" method="post" novalidate>          
            <div class="fitem">
                <label>生产计划单编号</label>
				<input name="id"  type="hidden" />
                <input name="purchasing_no" class="easyui-textbox" data-options="readonly:true,height:30" />
            </div>
            <div class="fitem">
                <label>申请部门</label>
				<select class="easyui-combobox" name="section_no" id="product_section_no" style="width:70px;height:30px;" data-options="required:true,editable:false,panelHeight:'false',validType:['length[2,30]','selected[]']">
                    <option value="0">未选择</option>
					<volist name="personnel_list" id="vo">
                        <option value="{$vo['no']}">{$vo['name']}</option>
                    </volist>
                </select> 
			</div>
			<div class="fitem">
                <label>产品名称</label>
                <input name="pro_name" type="text"  class="easyui-textbox" data-options="required:true,delay:1000,height:30,validType:['length[1,20]']" />
            </div>
			<div class="fitem">
                <label>产品规格</label>
                <input name="pro_spec" type="text"  class="easyui-textbox" data-options="required:true,delay:1000,height:30,validType:['length[1,20]']" />
            </div>
			<div class="fitem">
                <label>料号</label>
                <input name="source_no" type="text"  class="easyui-textbox" data-options="required:true,delay:1000,height:30,validType:['length[1,20]']" />
            </div>
			<div class="fitem">
                <label>产品编码</label>
                <input name="pro_no" type="text"  class="easyui-textbox" data-options="required:true,delay:1000,height:30,validType:['length[1,20]']" />
            </div>
			<div class="fitem">
                <label>批次</label>
                <input name="batch_no" type="text"  class="easyui-textbox" data-options="readonly:true,height:30" />
            </div>
			<div class="fitem">
                <label>制单人</label>
                <select class="easyui-combobox" name="people_make_no" id="product_people_make_no" style="width:70px;height:30px;" data-options="required:true,editable:false,panelHeight:'false',validType:['length[2,30]','selected[]']">
                    <option value="0">未选择</option>
					<volist name="personnel_list" id="vo">
                        <option value="{$vo['no']}">{$vo['name']}</option>
                    </volist>
                </select> 
            </div>
			<div class="fitem">
                <label>申请人</label>
                <select class="easyui-combobox" name="people_purchasing_no" id="product_people_purchasing_no" style="width:70px;height:30px;" data-options="required:true,editable:false,panelHeight:'false',validType:['length[2,30]','selected[]']">
                    <option value="0">未选择</option>
					<volist name="personnel_list" id="vo">
                        <option value="{$vo['no']}">{$vo['name']}</option>
                    </volist>
                </select>  
            </div>
        </form>
    </div>
    <div id="productorderEditButtons">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onclick="productorderObj.save('{:U('Product/productorderSave')}')" style="width:90px">更新</a>
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:
    $('#productorderEditDialog').dialog('close')" style="width:90px">取消</a>
    </div>
    <!-- /编辑 -->
	<!-- 编辑生产完成数量 -->
    <div id="productorderNumsEditDialog" class="easyui-dialog" style="width:400px;padding:10px 20px"
            closed="true" buttons="#productorderNumsEditButtons"  modal="true">
        <form id="productorderNumsEditForm" method="post" novalidate>          
            <div class="fitem">
                <label>生产计划单编号</label>
				<input name="id"  type="hidden" />
                <input name="purchasing_no" class="easyui-textbox" data-options="readonly:true,height:30" />
            </div>
			<div class="fitem">
                <label>账册编码</label>
                <input name="manua_id" type="text"  class="easyui-textbox" data-options="required:true,delay:1000,height:30,validType:['length[1,20]']" />
            </div>
			<div class="fitem">
                <label>条形码</label>
                <input name="bar_code" type="text"  class="easyui-textbox" data-options="required:true,delay:1000,height:30,validType:['length[1,20]']" />
            </div>
			<div class="fitem">
                <label>完成数量</label>
                <input name="pro_num" type="text"  class="easyui-textbox" data-options="required:true,delay:1000,height:30,validType:['length[1,20]']" />
            </div>
			<div class="fitem">
                <label>实际入库数量</label>
                <input name="inbound_num" type="text"  class="easyui-textbox" data-options="required:true,delay:1000,height:30,validType:['length[1,20]']" />
            </div>
			<div class="fitem">
                <label>合格品数量</label>
                <input name="conforming_p_num" type="text"  class="easyui-textbox" data-options="required:true,delay:1000,height:30,validType:['length[1,20]']" />
            </div>
			<div class="fitem">
                <label>残次品数量</label>
                <input name="nonconforming_p_num" type="text"  class="easyui-textbox" data-options="required:true,delay:1000,height:30,validType:['length[1,20]']" />
            </div>
			<div class="fitem">
                <label>报废品数量</label>
                <input name="scrap_one_num" type="text"  class="easyui-textbox" data-options="required:true,delay:1000,height:30,validType:['length[1,20]']" />
            </div>
			<div class="fitem">
                <label>入库成本单价</label>
                <input name="inbound_price" type="text"  class="easyui-textbox" data-options="required:true,delay:1000,height:30,validType:['length[1,20]']" />
            </div>
			<div class="fitem">
                <label>销售单价(含税)</label>
                <input name="sell_price" type="text"  class="easyui-textbox" data-options="required:true,delay:1000,height:30,validType:['length[1,20]']" />
            </div>
			<div class="fitem">
                <label>出厂价</label>
                <input name="factory_price" type="text"  class="easyui-textbox" data-options="required:true,delay:1000,height:30,validType:['length[1,20]']" />
            </div>

        </form>
    </div>
    <div id="productorderNumsEditButtons">
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-ok" onclick="productorderObj.saveNums('{:U('Product/productorderNumsSave')}')" style="width:90px">更新</a>
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:
    $('#productorderNumsEditDialog').dialog('close')" style="width:90px">取消</a>
    </div>
    <!-- /编辑生产完成数量 -->
    <!-- 搜索栏 -->
    <div id="productorder_tb">
        <form id="productorderSearchForm" method="post" novalidate>
             <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon icon-all" plain="true" onclick="productorderObj.showAll()">全部</a>     
			 转换单编号:<input class="easyui-textbox" name="changelist_order_no" style="width:150px;height:30px;">
			<a href="#" class="easyui-linkbutton searchBar" iconCls="icon-search" style="height:30px;">搜索</a>
        </form>
		<a href="javascript:void(0)" onclick="productorderObj.infoBar()" class="easyui-linkbutton" data-options="iconCls:'icon-information',plain:true">详情</a>
		<a href="javascript:void(0)" onclick="productorderObj.inboundBar()" class="easyui-linkbutton" data-options="iconCls:'icon-door_in',plain:true">入库</a>
		<a href="javascript:void(0)" onclick="productorderObj.editNumsBar()" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true">修改完成数量</a>
		<!-- <a href="javascript:void(0)" onclick="productorderObj.addBar()" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">添加</a> -->
        <!-- <a href="javascript:void(0)" onclick="productorderObj.editBar()" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true">修改</a> -->
        <!-- <a href="javascript:void(0)" onclick="productorderObj.removeBar()" class="easyui-linkbutton" data-options="iconCls:'icon-remove',plain:true">删除</a> -->
		<a href="javascript:void(0)" onclick="productorderObj.reloadBar()" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true">刷新</a>
		<a href="javascript:void(0)" onclick="productorderObj.saveBar()" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true">保存</a>
        <a href="javascript:void(0)" onclick="productorderObj.examineBar(1)" class="easyui-linkbutton" data-options="iconCls:'icon-key',plain:true">审核通过</a>
		<a href="javascript:void(0)" onclick="productorderObj.examineBar(2)" class="easyui-linkbutton" data-options="iconCls:'icon-key_delete',plain:true">审核不通过</a>
		<!-- <a href="javascript:void(0)" class="easyui-menubutton" data-options="menu:'#mm1',iconCls:'icon-recycle'">回收站</a> -->
		<!-- <a href="javascript:void(0)" onclick="productorderObj.printBar(1)" class="easyui-linkbutton" data-options="iconCls:'icon-information',plain:true">生产计划单</a> -->
		<!-- <a href="javascript:void(0)" onclick="productorderObj.printBar(2)" class="easyui-linkbutton" data-options="iconCls:'icon-information',plain:true">领料单</a> -->
		<a href="javascript:void(0)" onclick="productorderObj.printBar(3)" class="easyui-linkbutton" data-options="iconCls:'icon-information',plain:true">打印</a>
		<!-- <a href="javascript:void(0)" onclick="productorderObj.pushBar()" class="easyui-linkbutton" data-options="iconCls:'icon-world_go',plain:true">推送转换单</a> -->
		<!-- <div id="mm1" style="width:150px;"> -->
			<!-- <div onclick="productorderObj.recycle()">查看</div> -->
			<!-- <div onclick="productorderObj.undoBar()" data-options="iconCls:'icon-undo'">恢复</div> -->
			<!-- <div onclick="productorderObj.clearBar()" data-options="iconCls:'icon-remove'">删除</div> -->
		<!-- </div> -->
    </div>
    <!-- /搜索栏 -->
</body>